package cn.player.media.entity;

import java.io.Serializable;

import cntv.player.engine.Const;

public class VideoInfo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id;
	
	private String order;//当前播放节目的位置
	private int rate;//码率
	private int flag = Const.VOD;//Const.LIVE 直播; Const.VOD 点播
	private boolean isTimeShift;//是否支持時移
	private boolean isPort;//是否支持竖屏，默认不支持
	private boolean isAutoScreen = true;//是否支持自动横竖屏，默认支持
	
	private String title;
	private String detailUrl;// 直播时兼容旧播放地址，点播时正式地址
	
	private String channelId;// 直播频道ID
	private String p2pUrl;// p2p直播地址，也用来组装时移直播地址
	
	private String vid;//点播vid
	
	
	private AdInfo adInfo;// 获取广告相关信息
	private BaseInfo baseInfo;//备用实体信息

	private boolean isP2pProgress;//是否显示p2p初始化过程

	private boolean hasCollected;
	private boolean isCollected;
	private boolean isShared = true;

	private String hls_url;
	private float aspectRatio = Const.ASPECT_RATIO_SMALL;//半屏时，播放器视图宽高比



	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public boolean isTimeShift() {
		return isTimeShift;
	}

	/**
	 * 设置是否支持时移
	 * @param isTimeShift
	 */
	public void setTimeShift(boolean isTimeShift) {
		this.isTimeShift = isTimeShift;
	}

	public boolean isPort() {
		return isPort;
	}

	/**
	 * 设置是否支持竖屏，默认不支持
	 * 支持竖屏时，在横屏(全屏)的时候，点击返回按钮变为竖屏，否则退出播放器
	 * @param isPort
	 */
	public void setPort(boolean isPort) {
		this.isPort = isPort;
	}

	/**
	 * 获取是否支持自动横竖屏
	 * @return the isAutoScreen
	 */
	public boolean isAutoScreen() {
		return isAutoScreen;
	}

	/**
	 * 设置是否支持自动横竖屏，默认支持
	 * @param isAutoScreen the isAutoScreen to set
	 */
	public void setAutoScreen(boolean isAutoScreen) {
		this.isAutoScreen = isAutoScreen;
	}

	public String getTitle() {
		return title;
	}

	/**
	 * 设置视频标题
	 * @param title
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	public String getDetailUrl() {
		return detailUrl;
	}

	/**
	 * 设置播放地址
	 * @param detailUrl
	 */
	public void setDetailUrl(String detailUrl) {
		this.detailUrl = detailUrl;
	}

	public String getChannelId() {
		return channelId;
	}

	/**
	 * 设置频道Id
	 * @param channelId
	 */
	public void setChannelId(String channelId) {
		this.channelId = channelId;
	}

	public String getP2pUrl() {
		return p2pUrl;
	}

	/**
	 * 设置p2pUrl
	 * @param p2pUrl
	 */
	public void setP2pUrl(String p2pUrl) {
		this.p2pUrl = p2pUrl;
	}

	public String getVid() {
		return vid;
	}

	/**
	 * 设置点播Vid
	 * @param vid
	 */
	public void setVid(String vid) {
		this.vid = vid;
	}


	public boolean isHasCollected() {
		return hasCollected;
	}

	/**
	 * 设置是否已收藏
	 * @param hasCollected
	 * false
	 */
	public void setHasCollected(boolean hasCollected) {
		this.hasCollected = hasCollected;
	}

	/**
	 * 获取是否显示收藏按钮
	 * @return
	 */
	public boolean isCollected() {
		return isCollected;
	}

	/**
	 * 设置是否显示收藏按钮
	 * @param isCollected
	 */
	public void setCollected(boolean isCollected) {
		this.isCollected = isCollected;
	}

	/**
	 * 获取是否显示分享按钮
	 * @return
	 */
	public boolean isShared() {
		return isShared;
	}

	/**
	 * 设置是否显示分享按钮
	 * @param isSharedShow
	 */
	public void setShared(boolean isShared) {
		this.isShared = isShared;
	}

	/**
	 * 获取是否直播与点播
	 *
	 * @return
	 *		<ul>
	 *     	<li>{@link #Const}
	 *     	<li>Const.VOD 点播
	 * 		<li>Const.LIVE 直播
	 * 	</ul>
	 */
	public int getFlag() {
		return flag;
	}

	public AdInfo getAdInfo() {
		return adInfo;
	}

	/**
	 * 设置广告信息
	 * @param adInfo
	 */
	public void setAdInfo(AdInfo adInfo) {
		this.adInfo = adInfo;
	}

	/**
	 * 设置点播(Const.VOD)或者直播(Const.LIVE)
	 * @param flag
	 * 	<ul>
	 *     	<li>{@link #Const}
	 *     	<li>Const.VOD 点播
	 * 		<li>Const.LIVE 直播
	 * 	</ul>
	 */
	public void setFlag(int flag) {
		this.flag = flag;
	}

	public int getRate() {
		return rate == 0 ? Const.PLAYER_MODE_HD : rate;
	}

	/**
	 * 设置码率
	 * @param rate
	 * 	<ul>
	 * 		<li>{@link #Const}
	 *     	<li>Const.PLAYER_MODE_PD 超清
	 *     	<li>Const.PLAYER_MODE_HD 高清
	 *     	<li>Const.PLAYER_MODE_SD 标清
	 *     	<li>Const.PLAYER_MODE_TS 极速
	 *     	<li>Const.PLAYER_MODE_AUTO 自适应
	 * 	</ul>
	 */
	public void setRate(int rate) {
		this.rate = rate;
	}

	public BaseInfo getBaseInfo() {
		return baseInfo;
	}

	/**
	 * 设置备用信息
	 * @param baseInfo
	 *  可继承BaseInfo添加相应属性
	 */
	public void setBaseInfo(BaseInfo baseInfo) {
		this.baseInfo = baseInfo;
	}

	/**
	 * 获取点播最终播放地址.m3u8格式
	 * @return
	 */
	public String getHls_url() {
		return hls_url;
	}

	public void setHls_url(String hls_url) {
		this.hls_url = hls_url;
	}
	
	/**
	 * 获取半屏时，播放器视图宽高比，默认为4:3
	 * @return
	 */
	public float getAspectRatio() {
		return aspectRatio;
	}
	/**
	 * 设置半屏时，播放器视图宽高比，默认为4:3
	 * @param aspectRatio
	 */
	public void setAspectRatio(float aspectRatio) {
		this.aspectRatio = aspectRatio;
	}

	/**
	 * 是否显示p2p初始化过程
	 * @return the isP2pProgress
	 */
	public boolean isP2pProgress() {
		return isP2pProgress;
	}

	/**
	 * 设置是否显示p2p初始化过程
	 * @param isP2pProgress the isP2pProgress to set
	 */
	public void setP2pProgress(boolean isP2pProgress) {
		this.isP2pProgress = isP2pProgress;
	}
	
	

}
